<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <title>备货单</title>
    <link rel="stylesheet" href="../css/style.css"/>
    <link rel="stylesheet" href="../css/font-awesome.min.css"/>
</head>
<body>
<div class="container">
    <div class="header">
        <a href="../index.html"><i class="icon-angle-left icon-large"></i></a>备货单
        <span class="pull-right dropmenu plr1" data-menu="#shop" id="shop-name">筛选</span>
    </div>
    <ul class="dropdownmenu" id="shop">
        <li>全部</li>
        <li>仓库1</li>
        <li>仓库2</li>
        <li>仓库2</li>
        <li>仓库2</li>
        <li>仓库6</li>
    </ul>
    <div class="main" style="overflow-y: auto">
        <div id="wrapper">
            <div id="scroller">
                <div id="pullDown">
                    <span class="pullDownLabel">下拉刷新</span>
                </div>
                <div id="thelist">

                    <a href="beihuodanxq.html" class="sgls-item mt1">
                        <p>
                            <span class="title">单据编号：</span><span>备货-D0000001</span>
                        </p>

                        <p>
                            <span class="title pull-left">要货门店：</span><span class="span4">三香店</span>
                            <span class="pull-right"><i class="title">仓库：</i><i class="text-nowrap">仓库1</i></span>
                        </p>

                        <p>
                            <span class="title">下单时间：</span><span>2016.7.22 16:00</span>
                            <span class="pull-right"><i class="title">下单人：</i><i>李小姐</i></span>
                        </p>

                        <p>
                            <span class="title">要求到货时间：</span><span>2016.7.22</span>
                        </p>
                    </a>
                    <a href="beihuodanxq.html" class="sgls-item mt1">
                        <p>
                            <span class="title">单据编号：</span><span>备货-D0000001</span>
                        </p>

                        <p>
                            <span class="title pull-left">要货门店：</span><span class="span4">三香店</span>
                            <span class="pull-right"><i class="title">仓库：</i><i class="text-nowrap">仓库1</i></span>
                        </p>

                        <p>
                            <span class="title">下单时间：</span><span>2016.7.22 16:00</span>
                            <span class="pull-right"><i class="title">下单人：</i><i>李小姐</i></span>
                        </p>

                        <p>
                            <span class="title">要求到货时间：</span><span>2016.7.22</span>
                        </p>
                    </a>
                </div>
                <div id="pullUp">
                    <span class="pullUpLabel">上拉加载更多</span>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../js/zepto.min.js"></script>
<script src="../js/dropdownmenu.js"></script>
<script src="../js/iscroll.js"></script>
<script src="../js/iscroll-main.js"></script>
<script>
    $(function () {
        $('.dropmenu').dropdownmenu();
//        debugger;
        if (localStorage.getItem('cangku')  && localStorage.getItem('cangku') != '全部') {
            $('#shop-name').text(localStorage.getItem('cangku'));
        }
        $('.dropdownmenu li').on('click', function () {
            $('#shop-name').text($(this).text());
            var name=$(this).text();
            localStorage.setItem('cangku',name);
        });
    });
    //初始状态，加载数据
    function loadAction() {
        var el, item;
        el = document.getElementById('thelist');
        for (var i = 0; i < 10; i++) {
            //li = document.createElement('li');
            item = document.createElement('div');
            //li.innerText = '初始数据--' + (++generatedCount);
            item.innerHTML = "<a href='beihuodanxq.html' class='sgls-item mt1'>" +
                    "<p>" +
                    "<span class='title'>单据编号：</span><span>备货-D0000001</span>" +
                    "</p>" +
                    "<p>" +
                    "<span class='title pull-left'>要货门店：</span><span class='span4'>三香店</span>" +
                    "<span class=pull-right><i class='title'>仓库：</i><i class='text-nowrap'>仓库1</i></span>" +
                    "</p>" +
                    "<p>" +
                    "<span class='title'>下单时间：</span><span>2016.7.22 16:00</span>" +
                    "<span class='pull-right'><i class='title'>下单人：</i><i>李小姐</i></span>" +
                    "</p>" +
                    "<p>" +
                    "<span class='title'>要求到货时间：</span><span>2016.7.22</span>" +
                    "</p>" +
                    "</a>";
            el.appendChild(item, el.childNodes[0]);
        }
        myScroll.refresh();
    }

    //下拉刷新当前数据
    function pullDownAction() {
        setTimeout(function () {
            //这里执行刷新操作

            myScroll.refresh();
        }, 400);
    }

    //上拉加载更多数据
    function pullUpAction() {
        setTimeout(function () {
            var el, item;
            el = document.getElementById('thelist');
            for (var i = 0; i < 10; i++) {
                item = document.createElement('div');
                item.innerHTML = "<a href='beihuodanxq.html' class='sgls-item mt1'>" +
                        "<p>" +
                        "<span class='title'>单据编号：</span><span>备货-D0000001</span>" +
                        "</p>" +
                        "<p>" +
                        "<span class='title pull-left'>要货门店：</span><span class='span4'>三香店</span>" +
                        "<span class=pull-right><i class='title'>仓库：</i><i class='text-nowrap'>仓库1</i></span>" +
                        "</p>" +
                        "<p>" +
                        "<span class='title'>下单时间：</span><span>2016.7.22 16:00</span>" +
                        "<span class='pull-right'><i class='title'>下单人：</i><i>李小姐</i></span>" +
                        "</p>" +
                        "<p>" +
                        "<span class='title'>要求到货时间：</span><span>2016.7.22</span>" +
                        "</p>" +
                        "</a>";
                el.appendChild(item, el.childNodes[0]);
            }
            myScroll.refresh();
        }, 400);
    }
    <!--20160812新增弹框-->
</script>
</body>
</html>